//
//  MainViewController.swift
//  DollarBuy
//
//  Created by 郑东喜 on 2016/11/6.
//  Copyright © 2016年 郑东喜. All rights reserved.
//  用来布局tabbarcontroller 四个子页面

import UIKit

class MainViewController: CustomTabBarController  {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        setUpSubViews()
    }
    
    
}

// MARK:- 设置子界面
extension MainViewController {
    func setUpSubViews() -> Void {
//        let mainPageVC = MainPageViewController()
//        let shopVc = ShoppingViewController()
//        let meVC = MeViewController()
//        let serviceVC = ServiceViewController()
//        let commuVC = CommuViewController()
//
        
        //为每个子页面独立添加导航栏
        let mainPageVC = RZNavigationController.init(rootViewController: MainPageViewController())
        let shopVc = RZNavigationController.init(rootViewController: ShoppingViewController())
        let meVC = RZNavigationController.init(rootViewController: MeViewController())
        let serviceVC = RZNavigationController.init(rootViewController: ServiceViewController())
        let commuVC = RZNavigationController.init(rootViewController: CommuViewController())
        
        
        self.setupChildVC(mainPageVC, title: "首页", imageName: "tabbar_home", selectImageName: "tabbar_home_highlighted", isAnimation: .tabbarHideWithAnimation)
        
        self.setupChildVC(shopVc, title: "购物车", imageName: "tabbar_home", selectImageName: "tabbar_home_highlighted", isAnimation: .tabbarHideWithAnimation)
        
        self.setupChildVC(meVC, title: "我的", imageName: "tabbar_home", selectImageName: "tabbar_home_highlighted", isAnimation: .tabbarHideWithAnimation)
        
        self.setupChildVC(serviceVC, title: "服务区", imageName: "tabbar_home", selectImageName: "tabbar_home_highlighted", isAnimation: .tabbarHideWithAnimation)
        
        self.setupChildVC(commuVC, title: "交流区", imageName: "tabbar_home", selectImageName: "tabbar_home_highlighted", isAnimation: .tabbarHideWithAnimation)



    }
    
}
